﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//first learning 
namespace Day1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Now we start sailing!");
            int num1 = 1;
            int num2 = 2;
            num1 = num2;
            num2 = 3;
            Console.WriteLine(num1);
            Console.WriteLine(num2);
            //String也是引用类型，只是字面值等操作都会返回一个新的字符串对象
            String name1 = "name1";
            String name2 = name1;
            name2.Insert(0,"str");
            Console.WriteLine(name1);
             Console.WriteLine(name2);
            //引用类型赋值
            MyClass class1 = new MyClass();
            class1.name = "Cherry";
            MyClass class2 = class1;
            //is运算符相当于instanceof
            string name = null;
              
            Console.WriteLine(name);
            Type mytype = typeof(MyClass);
            Console.WriteLine(mytype);
            Console.WriteLine(class2 is MyClass);
            class2.name = "Micle";
            Console.WriteLine(class1.name);
            Console.WriteLine("name1 = {0},name2 = {1}", name1, name2);
            // Console.WriteLine(name1);
            // Console.WriteLine(name2);
            decimal wage1 = (decimal)Math.PI;
            double wage2 = (double)Math.PI;
            float wage3 = (float)Math.PI;
            Console.WriteLine(wage1);
            Console.WriteLine(wage2);
            Console.WriteLine(wage3);
            bool isLeft = false;
            Console.WriteLine(isLeft);
            Console.WriteLine("--------------------------------------------------------------------------------");
            Console.WriteLine("");
            goto Found;
            //使用StringBuilder 创建的引用 在操作的时候不会随便新建一个字符串
            StringBuilder str1 = new StringBuilder("尊嘟假嘟啊");
            StringBuilder str2 = str1;
            str1.Append("!");
            Console.WriteLine(str2);
            Found:
            Console.ReadLine();
        }
    }
    class MyClass
    {
       public String name;
        
    }
}
